import React from 'react'
import Comp1 from '../../components/Comp1'
class Index extends React.PureComponent {
  state = {
    count: 1
  }
  addCount = () => {
    this.setState({
      count: this.state.count + 1
    })
  }
  render() {
    const { count } = this.state
    return (
      <div>
        父组件
        <h3>{ count }</h3>
        <button onClick={this.addCount}>+1</button>
        <hr />
        <Comp1 count={count}  addCount={this.addCount}></Comp1>
      </div>  
    )
  }
}

export default Index